﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRasta.Web;
using uREST.Core.Attributes;
using uREST.Core.Resources;
using uREST.Core.Services;

namespace uREST.Core.Handlers
{
    public class EndPointHandler : AbstractHandler
    {
        public EndPointHandler(ICommunicationContext context) 
            : base(context)
        { }

        [HttpOperation(ForUriName = "EndPointList")]
        public OperationResult GetEndPointList()
        {
            return new OperationResult.OK 
            { 
                ResponseResource = ServiceFactory.Services.Select(service => service.EndPoint).ToList() 
            };
        }
    }
}
